package com.lyj.stuelasticsearch.repository;
import com.lyj.stuelasticsearch.entity.Product;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductRepository extends ElasticsearchRepository<Product, String> {

    List<Product> findByName(String name);

    List<Product> findByPriceBetween(Double price1, Double price2);

    List<Product> findByCategory(String category);

    List<Product> findByNameOrDescription(String name, String description);
}